home *** CD-ROM | disk | FTP | other *** search
- class smashing.SoundHandler
- {
- var location;
- var aSnd;
- var cSound = 0;
- function SoundHandler(loc)
- {
- this.location = loc;
- this.aSnd = [];
- var _loc3_ = undefined;
- var _loc2_ = 0;
- while(_loc2_ < 8)
- {
- _loc3_ = loc.createEmptyMovieClip("mcSnd" + _loc2_,_loc2_);
- this.aSnd[_loc2_] = new Sound(_loc3_);
- _loc2_ = _loc2_ + 1;
- }
- }
- function playSnd(sId, vol)
- {
- var _loc2_ = this.aSnd[this.cSound];
- _loc2_.stop();
- if(vol != undefined)
- {
- _loc2_.setVolume(vol);
- }
- else
- {
- _loc2_.setVolume(100);
- }
- _loc2_.attachSound(sId);
- _loc2_.start();
- this.cSound = this.cSound + 1;
- if(this.cSound >= this.aSnd.length)
- {
- this.cSound = 0;
- }
- return _loc2_;
- }
- }
-